﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JiuQianTSMX_ZJ.aspx.cs" Inherits="Web.Pages.YongShui.JiuQianTSMX_ZJ" Theme="Default" %>
<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../../../css/inputBgColor.css" rel="stylesheet" />
    <script src="../../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript">

        function yonghuhSearch()
        {
            if(event.keyCode==13)
            {
                if (txtYongHuH.GetText() == "") {
                    return;
                }
                if (txtYongHuH.GetText().length!=7)
                {
                    alert("用户号应为7位");
                    return;
                }
                ASPxCallback1.PerformCallback("yonghuh");
                LoadPanel.Show();
            }
        } 
        function ymSearch() {
            if (event.keyCode == 13) {
                if (txtYM.GetText()=="")
                {
                    return;
                }
                if (txtYM.GetText().length != 6) {
                    alert("请输入正确的水量年月(示例:200603)");
                    return;
                }
                ASPxCallback1.PerformCallback("ym");
                LoadPanel.Show();
            }
        }
        function add() {
            if (txtYongHuH.GetText() == "")
            {
                alert("请输入用户号！");
                return;
            }
            if (txtYM.GetText() == "") {
                alert("请输入水量年月！");
                return;
            }
            if (txtJinE.GetText() == "") {
                alert("请输入金额！");
                return;
            }
            if (txtJinE.GetText() == "0") {
                alert("请输入正确的金额！");
                return;
            }
            ASPxCallback1.PerformCallback("add");
            LoadPanel.Show();
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            var specialIdentity = arr[2];
            var msg = arr[3].split('-');
            LoadPanel.Hide();
            if (msg[0] == 'True') {
                alert(msg[1]);
            }
            //debugger;
            hdCollection.Set("type", type);
            if (state == 'True') {
                if (type == "yonghuh")
                {
                    txtYongHuM.SetText(arr[4]);
                    txtDiZhi.SetText(arr[5]);
                    txtKaiHuHM.SetText(arr[6]);
                    txtKaiHuZH.SetText(arr[7]);
                    txtKaiHuYH.SetText(arr[8]);
                    txtYM.SetText("");
                    txtYM.Focus();
                }
                else if (type == "ym") {
                    txtJinE.SetText(arr[4]);
                }
                else if (type == "add") {
                    txtYM.SetText("");
                    txtJinE.SetText("");
                    txtShouFeiBH.SetText(arr[4]);
                    txtZongBiS.SetText(arr[5]);
                    txtZongJinE.SetText(arr[6]);
                    gvList1.PerformCallback();
                    txtYongHuH.Focus();
                }
            }
            else {
                if (type == "yonghuh") {
                    txtYongHuM.SetText("");
                    txtDiZhi.SetText("");
                    txtKaiHuHM.SetText("");
                    txtKaiHuZH.SetText("");
                    txtKaiHuYH.SetText("");
                    txtYongHuH.Focus();
                }
                else if (type == "ym") {
                    txtJinE.SetText("0.00");
                }

            }
        }
</script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
        <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        <dx:ASPxLoadingPanel ID="ASPxLoadingPanel1" ClientInstanceName="LoadPanel" runat="server"></dx:ASPxLoadingPanel>

                <div style="margin: auto; width: 98%">
                    <div class="tabletitle1" align="center">
                        增加旧欠托收明细
                    </div>
                    <div>
                        <div>
                            <table>
                                <tr>
                                    <td>进帐单编号：</td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtShouFeiBH" ClientInstanceName="txtShouFeiBH" runat="server" Width="170px" ClientEnabled="false"></dx:ASPxTextBox>
                                    </td>
                                    <td>笔数：</td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtZongBiS" ClientInstanceName="txtZongBiS" runat="server" Width="120px" ClientEnabled="false"></dx:ASPxTextBox>
                                    </td>
                                    <td>金额：</td>
                                    <td>
                                        <dx:ASPxTextBox ID="txtZongJinE" ClientInstanceName="txtZongJinE" runat="server" Width="120px" ClientEnabled="false"></dx:ASPxTextBox>
                                    </td>
                                </tr>
                            </table>
                            <hr />
                            <div>
                                <div style="width: 52%;float: left;">
                                    <dx:ASPxGridView ID="gvList1" ClientInstanceName="gvList1" runat="server" AutoGenerateColumns="False" KeyFieldName="I_TUOSHOUPZH" Theme="Aqua1" Width="100%" OnCustomCallback="gvList1_CustomCallback">
                                        <Columns>
                                            <dx:GridViewDataTextColumn FieldName="S_YONGHUH" Caption="用户号" Width="20%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="I_YM" Caption="水量月" Width="15%" CellStyle-HorizontalAlign="Center">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="N_JINE" Caption="金额" Width="25%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="S_KAIHUHM" Caption="开户户名" Width="40%">
                                            </dx:GridViewDataTextColumn>
                                        </Columns>
                                        <Settings VerticalScrollableHeight="280" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                                        <SettingsBehavior AllowSort="false"/>
                                    </dx:ASPxGridView>               
                                </div>
                                <div style="width: 1%;float: left;">&nbsp;</div>
                                <div style="width: 47%;float: left;" class="div">
                                    <table>
                                        <tr>
                                            <td align="right" style="width:20%">管理块号：
                                            </td>
                                            <td style="width:20%">
                                                <dx:ASPxTextBox ID="txtGuanLiKH" runat="server" Width="50%" Enabled="false"></dx:ASPxTextBox>
                                            </td>
                                            <td style="width:60%">

                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">用户号：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtYongHuH" ClientInstanceName="txtYongHuH" runat="server" Width="100%">
                                                    <ClientSideEvents KeyUp="function(s,e){inputNum(s);yonghuhSearch();}" />
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td align="right">用户户名：
                                            </td>
                                            <td colspan="2">
                                                <dx:ASPxTextBox ID="txtYongHuM" ClientInstanceName="txtYongHuM" runat="server" Width="100%"  ClientEnabled="false"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">用户地址：
                                            </td>
                                            <td colspan="2">
                                                <dx:ASPxTextBox ID="txtDiZhi" ClientInstanceName="txtDiZhi" runat="server" Width="100%" ClientEnabled="false"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">水量年月：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtYM" ClientInstanceName="txtYM" runat="server" Width="100%">
                                                    <ClientSideEvents  KeyUp="function(s,e){inputNum(s);ymSearch();}"/>
                                                </dx:ASPxTextBox>
                                            </td>
                                             <td></td>
                                        </tr>
                                        <tr>
                                            <td align="right">金额：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtJinE" ClientInstanceName="txtJinE" runat="server" Width="100%" HorizontalAlign="Right" ClientSideEvents-KeyUp="function(s,e){inputFloat(s);}"></dx:ASPxTextBox>
                                            </td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td align="right">开户户名：
                                            </td>
                                            <td colspan="2">
                                                <dx:ASPxTextBox ID="txtKaiHuHM" ClientInstanceName="txtKaiHuHM" runat="server" Width="100%"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">银行账号：
                                            </td>
                                            <td colspan="2">
                                                <dx:ASPxTextBox ID="txtKaiHuZH" ClientInstanceName="txtKaiHuZH" runat="server" Width="100%"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">开户银行：
                                            </td>
                                            <td colspan="2">
                                                <dx:ASPxTextBox ID="txtKaiHuYH" ClientInstanceName="txtKaiHuYH" runat="server" Width="100%"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                    </table>
                                    <div>
                                        <table style="width: 100%;">
                                            <tr>
                                                <td align="right">
                                                    <hr />
                                                    <dx:ASPxButton ID="btnAdd" runat="server" Text="增加" UseSubmitBehavior="false" AutoPostBack="false" ClientSideEvents-Click="function(s,e){add();}"></dx:ASPxButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>




